package org.familysearch.fsapi.gwt.server.servlets;

import org.familysearch.fsapi.gwt.common.client.entities.Person;
import org.familysearch.fsapi.gwt.server.api.APIException;
import org.familysearch.fsapi.gwt.server.api.PersonAPI;
import org.familysearch.fsapi.gwt.services.client.PersonService;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class PersonServlet extends RemoteServiceServlet implements PersonService {

	private static final long serialVersionUID = 4116643980801834606L;
	private PersonAPI personAPI = new PersonAPI();

	public PersonServlet()
    {
        
    }

	public Person getPerson(Person person) {
        try {
        	person = personAPI .getPerson(person);
        } catch (APIException e) {
            //TODO: determine which e to throw (API or Server)
        }
        return person;
	}
    
}
